package com.itheima.exception;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

public class Demo01 {

    public static void main(String[] args) throws ParseException {

        int[] arr = new int[5];
        //System.out.println(arr[10]);//ArrayIndexOutOfBoundsException
      //  arr=null;
        System.out.println(arr[0]);//NullPointerException
        Object o = new Object();
        //String s= (String) o;//ClassCastException
        //System.out.println(s);

        String  dateStr="2050年12月31日";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
        Date date = sdf.parse(dateStr);//ParseException
        System.out.println(date);
        //sing();//StackOverflowError
        String s="a";
      //  System.out.println(s.charAt(1));
        sing();
    }

    public static void sing(){
      System.out.println(1/0);
    }
}
